/*
 * 组件注释
 * @Author: machinist_wq
 * @Date: 2022-06-30 15:59:32
 * @LastEditors: machinist_wq
 * @LastEditTime: 2022-06-30 16:57:42
 * @Description: 这里是所有的示例代码
 * 人生无常！大肠包小肠......
 */

// 基本用法
export const basicCode: string = `
import SearchForm from "@/component/searchForm";

const dataSource = [
  {
    label: "label",
    name: "select",
    placeholder: "placeholder",
    type: "select", // input
    option: [
      {
        key: "key",
        value: "value",
      },
    ],
  },
  {
    label: "label",
    name: "time",
    placeholder: "placeholder",
    type: "date",
    picker: "year",
    format: "YYYY-MM-DD",
  },
  {
    text: "label",
    name: "checkbox",
    type: "checkbox",
  },
];
const App = () => {
  return <SearchForm dataSource={dataSource} onFinish={values => console.log(values)}/>;
};

export default App;
`;
// 带重置功能
export const resetCode: string = `
import SearchForm from "@/component/searchForm";

const dataSource = [
  {
    name: "select",
    placeholder: "placeholder",
    type: "select", // input
    option: [
      {
        key: "key",
        value: "value",
      },
    ],
  },
  {
    name: "time",
    placeholder: "placeholder",
    type: "date",
    picker: "year",
    format: "YYYY-MM-DD",
  },
  {
    name: "checkbox",
    type: "checkbox",
  },
];
const App = () => {
  return (
    <SearchForm
      dataSource={dataSource}
      isReset
      automatic
      onFinish={values => console.log(values)}
    />
  );
};

export default App;
`;
// 自定义
export const customCode: string = `
import { Input } from "antd";
import SearchForm from "@/component/searchForm";

const dataSource = [
  {
    name: "checkbox",
    element: <Input placeholder="请输入关键字" />,
  },
  {
    name: "select",
    placeholder: "placeholder",
    type: "select", // input
    option: [
      {
        key: "key",
        value: "value",
      },
    ],
  },
];
const App = () => {
  return (
    <SearchForm dataSource={dataSource} onFinish={values => console.log(values)}/>
  );
};

export default App;
`;
